/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

/* 应用容器 */
.app-container {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 认证页面样式 */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    transition: transform 0.3s ease;
}

.auth-container:hover {
    transform: translateY(-5px);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
}

.logo p {
    color: #7f8c8d;
    font-size: 14px;
}

/* 表单样式 */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.password-input-wrapper {
    position: relative;
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
}

.toggle-password-btn:hover {
    text-decoration: underline;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.remember-me input {
    margin-right: 8px;
}

.forgot-password {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
}

.forgot-password:hover {
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f6dad);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.register-link,
.login-link,
.back-link {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
}

.register-link:hover,
.login-link:hover,
.back-link:hover {
    text-decoration: underline;
}

/* 消息提示 */
.error-message {
    background: #ffeaa7;
    color: #d63031;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.success-message {
    background: #d6ffed;
    color: #00b894;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

.password-strength.weak {
    background: #ffeaa7;
    color: #d63031;
}

.password-strength.medium {
    background: #fdcb6e;
    color: #e67e22;
}

.password-strength.strong {
    background: #d6ffed;
    color: #00b894;
}

/* 主页面样式 */
.main-page {
    min-height: 100vh;
}

/* 顶部导航栏 */
.header {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left h1 {
    color: #2c3e50;
    font-size: 24px;
}

.header-center {
    flex: 1;
    max-width: 500px;
    min-width: 250px;
}

.search-wrapper {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e1e4e8;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
}

.search-btn:hover {
    background: #2980b9;
}

.header-right {
    display: flex;
    gap: 10px;
}

.settings-btn,
.logout-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.settings-btn {
    background: #f1f2f6;
    color: #2c3e50;
}

.settings-btn:hover {
    background: #e1e4e8;
}

.logout-btn {
    background: #e74c3c;
    color: white;
}

.logout-btn:hover {
    background: #c0392b;
}

/* 分类栏 */
.categories {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #3498db #f1f2f6;
}

.categories::-webkit-scrollbar {
    height: 6px;
}

.categories::-webkit-scrollbar-track {
    background: #f1f2f6;
    border-radius: 3px;
}

.categories::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid #e1e4e8;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.category-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 账号列表 */
.accounts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 80px;
}

.account-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.account-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.account-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
}

.account-info {
    flex: 1;
}

.account-name {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.account-username {
    font-size: 14px;
    color: #7f8c8d;
}

.account-actions {
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.account-item:hover .account-actions {
    opacity: 1;
}

.edit-btn,
.delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background: #c0392b;
}

/* 新增按钮 */
.add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.6);
}

/* 详情页面样式 */
.detail-page {
    min-height: 100vh;
}

.detail-header {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    padding: 10px 20px;
    background: #f1f2f6;
    color: #2c3e50;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.back-btn:hover {
    background: #e1e4e8;
}

.detail-header h1 {
    color: #2c3e50;
    font-size: 20px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.detail-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.detail-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e4e8;
}

.detail-group:last-child {
    border-bottom: none;
}

.detail-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-group p {
    font-size: 18px;
    color: #2c3e50;
    word-break: break-all;
}

.url-link {
    color: #3498db;
    text-decoration: none;
    font-size: 18px;
    word-break: break-all;
}

.url-link:hover {
    text-decoration: underline;
}

.password-display-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 表单页面样式 */
.form-page {
    min-height: 100vh;
}

.form-header {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header h1 {
    color: #2c3e50;
    font-size: 20px;
}

.generate-btn {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.generate-btn:hover {
    background: #229954;
}

.account-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.save-btn,
.cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.save-btn {
    background: #27ae60;
    color: white;
}

.save-btn:hover:not(:disabled) {
    background: #229954;
}

.save-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.cancel-btn {
    background: #f1f2f6;
    color: #2c3e50;
}

.cancel-btn:hover {
    background: #e1e4e8;
}

/* 设置页面样式 */
.settings-page {
    min-height: 100vh;
}

.settings-header {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.settings-header h1 {
    color: #2c3e50;
    font-size: 20px;
}

.settings-content {
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group h2 {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.setting-item:hover {
    background: #f8f9fa;
}

.setting-item span:first-child {
    color: #2c3e50;
    font-size: 16px;
}

.arrow {
    font-size: 20px;
    color: #bdc3c7;
}

.version {
    color: #7f8c8d;
    font-size: 14px;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    justify-content: space-between;
}

.toggle-text {
    color: #2c3e50;
    font-size: 16px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e4e8;
}

.modal-header h3 {
    color: #2c3e50;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f1f2f6;
    color: #2c3e50;
}

.modal-form {
    padding: 20px;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e1e4e8;
}

.confirm-btn,
.apply-btn,
.regenerate-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.confirm-btn {
    background: #3498db;
    color: white;
}

.confirm-btn:hover:not(:disabled) {
    background: #2980b9;
}

.confirm-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.apply-btn {
    background: #27ae60;
    color: white;
}

.apply-btn:hover {
    background: #229954;
}

.regenerate-btn {
    background: #f1f2f6;
    color: #2c3e50;
}

.regenerate-btn:hover {
    background: #e1e4e8;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 10px;
}

.generated-password {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.generated-password input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    font-size: 16px;
}

.copy-btn {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.copy-btn:hover {
    background: #2980b9;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state p {
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .auth-container {
        padding: 30px 20px;
    }
    
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-left h1 {
        text-align: center;
        font-size: 20px;
    }
    
    .header-center {
        min-width: 100%;
    }
    
    .header-right {
        justify-content: center;
    }
    
    .accounts-list {
        grid-template-columns: 1fr;
    }
    
    .account-item {
        padding: 15px;
    }
    
    .add-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .detail-header,
    .form-header,
    .settings-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .detail-header h1,
    .form-header h1,
    .settings-header h1 {
        flex: 1;
        min-width: 0;
        font-size: 18px;
    }
    
    .detail-content,
    .account-form {
        padding: 20px;
    }
    
    .detail-group p,
    .url-link {
        font-size: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .save-btn,
    .cancel-btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 25px 15px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .password-display-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .generated-password {
        flex-direction: column;
    }
}